import time
from multiprocessing import Pool

def text(x,y):
    # 执行脚本，执行过程中需要2s等待
    print("~~~~")
    time.sleep(2)
    print(x+y)

if __name__ == '__main__':
    n=2
    pool = Pool(n)

    re=[]
    for i in range(n):
        res=pool.apply_async(text,(1,2))
        re.append(res)

    for i in re:
        i.get()
    print("finshed")
